
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
<link href="{THEME_STYLE_PATH}style/css/default_new.css" type="text/css" rel="stylesheet" />
<script src="{THEME_STYLE_PATH}style/js/jquery.min.js"></script>
<script src="{THEME_STYLE_PATH}style/js/core.js"></script>
<!--script src="http://l.tbcdn.cn/apps/top/x/sdk.js?appkey=21635038"></script-->
<link href="{THEME_STYLE_PATH}style/css/percenter.css" type="text/css" rel="stylesheet" />
<!--[if IE 6]>
<script src="/js/DD_belatedPNG.js"></script>
<script>
  DD_belatedPNG.fix('*');
</script>
<![endif]-->
<!--[if IE 6]>
<style type="text/css">
    html{overflow:hidden;}
    body{height:100%;overflow:auto;}
</style>
<![endif]-->
</head>

<body>

	{include template('header','common')}	
	<!--主体-->
	<div id="Mainbox">
		<!--插入侧边栏-->
		{include template('sidebar_login','common')}
		<!--插入侧边栏-->
		{include template('top_advance','common')}
		
		<!-- 左侧 -->
		{include template('member_left','common')}
		<!--右侧-->
		<div class="percenter_right">
			<div class="aboutper_acc">
				<p class="a1" style="margin-bottom:10px;">绑定手机号</p>
				<div style="line-height:24px;">
				<strong style="float:14px;">手机认证目的</strong><br>
<strong>1.</strong> 为了保证账号的<b class="re1">安全性</b>。<!--账号登录可以通过手机验证进行验证登录。兑奖的时候也会发验证码，保证兑奖安全。-->修改提现账户也会发验证码，确保提现账户安全。（后续会增加更多手机验证安全服务！）<br>
<strong>2.</strong> 为了保证账号的<b class="re1">唯一性</b>。及时赚是一个实名制网站，一个用户只可注册和使用一个账号。<br>
<span class="re1">注意： 一个手机只能绑定且认证一个账号。</span><br>
</div>	
				{if $info['phone_status']==1}
				<div style=" border-top:1px solid #dedede; padding-top:25px; margin-top:20px; margin-bottom:20px; font-size:14px; font-weight:bold">成功绑定手机号：<span class="re1"><?php echo substr_replace($sms['mobile'],'xxxx',3,4);?></span></div>
				{else}		
				<ul class="cft_list" style=" border-top:1px solid #dedede; padding-top:25px; margin-top:20px; margin-bottom:20px;">
					<li class="a1">手机号：</li>
					<li class="a2"><input type="text" style="width:150px;" id="tbPhone" />&nbsp;&nbsp;<span id="phoneArea"><a href="javascript:void(0);" onclick="getCode()" class="b40link">点击获取验证码</a></span>&nbsp;&nbsp;<span class="re1" id="tbPhone_w" style="display:none;"></span><img id="tbPhone_s" src="{THEME_STYLE_PATH}style/images/login/right.png"  style="vertical-align:-5px;display:none;"/></li>
					<li class="a1">验证码：</li>
					<li class="a2"><input type="text" style="width:50px;" maxlength="6" id="tbCode"/>&nbsp;&nbsp;<span class="da3" id="tbCode_i">请输入收到的验证码！</span><span class="re1" id="tbCode_w" style="display:none;"></span><img id="tbCode_s" src="{THEME_STYLE_PATH}style/images/login/right.png"  style="vertical-align:-5px;display:none;"/></li>
					<li class="a1"></li>
					<li class="a2"><a href="javascript:void(0);" class="editbtn">确认绑定</a></li>
				</ul>
				{/if}
							  <div style="line-height:22px; color:#a3a3a3;">
			  温馨提示：<br>
1. 接收手机验证码短信免费；手机验证不会产生任何其他费用。<br>
2. 验证码一天最多发送3次，如果3次都收不到，可能是因为短信通道堵塞，要改天再验证。<br>
3. 为保证验证码安全，验证码的有效期为10分钟；输入错误10次后自动失效。<br>
4. 一个手机号码只能验证一个账号。<br>
</div>
			</div>			
		</div>
		<!--右侧-->
		<div class="clear"></div>
	</div>
	<!--主体-->
	<!--尾部-->
	{include template('footer','common')}
	<!--尾部-->
</body>
</html>
<script type="text/javascript"><!--
var v = juxiangyou.component.verification;
var phone_s = false;var code_s = false;
var phone,code;var limit = true;
$(document).ready(function() {
	$('#tbPhone').focus(function(){
		var id = this.id;
		if($(this).val()=='请输入手机号码'){
			$(this).val('');
		}
		switchTip(id,0);
	}).blur(function(){
		var id = this.id;var value = $.trim($(this).val());
		if(value=='请输入手机号码'){return false;}
		if(value){
			if(v.chkPhone(value)==false){
				$('#'+id+'_w').html('格式输入有误！');phone_s = false;switchTip(id,2);
			}else{
				phone_s = true;switchTip(id,1);
			}
		}else{
			phone_s = false;switchTip(id,0);
		}
	});
	

	
	//$('#tbCode').keyup(function(){
	//	var id = this.id;var value = $.trim($(this).val());
	//	if(!limit || !value) return;
	//	if(v.chkInt(value,6,6)==false){
	//			$('#'+id+'_w').html('格式输入有误！');code_s = false;switchTip(id,2);return;
	//	}
	//	if(code_s){
	//		$('#phoneArea').hide();switchTip(id,1);
	//	}else{
	//		$('#'+id+'_i').css('color','#a3a3a3');switchTip(id,0);
	//	}
	//	limit = false;
	//	if(value && code!=value){
	//		code = value;
	//		$.ajax({
	//			type: "POST",
	//			url: "/personal/Phone/",
	//			dataType: "json",
	//			data : {"act":"chkCode","code":value},
	//			success: function(strJson){
	//				if(strJson.error==10000){
	//					$('#phoneArea').hide();code_s = true;switchTip('tbCode',1);
	//					var id = 'tbPhone';var value = $.trim($('#tbPhone').val());
	//					if(value=='请输入手机号码'){return false;}
	//					if(value){
	//						if(v.chkPhone(value)==false){
	//							$('#'+id+'_w').html('格式输入有误！');phone_s = false;switchTip(id,2);
	//						}else{
	//							phone_s = true;switchTip(id,1);
	//						}
	//					}else{
	//						phone_s = false;switchTip(id,0);
	//					}
	//				}else{
	//					var id = 'tbCode';$('#phoneArea').show();$('#'+id+'_w').html(strJson.msg);code_s = false;switchTip(id,2);
	//				}
	//			}
	//		});
	//	}limit  = true;
	//});
	
	$('.editbtn').click(function(){
		var id = "tbCode";
		var value = $.trim($("#tbCode").val());
		var tel=$.trim($("#tbPhone").val());
		if(!limit || !value) return;
		if(v.chkInt(value,6,6)==false){
			$('#'+id+'_w').html('格式输入有误！');code_s = false;switchTip(id,2);return;
		}
		if(code_s){
			$('#phoneArea').hide();switchTip(id,1);
		}else{
			$('#'+id+'_i').css('color','#a3a3a3');switchTip(id,0);
		}
		limit = false;
		if(value && code!=value){
			code = value;
			$.ajax({
				type: "POST",
				url: "{U('Member/Profile/binding')}",
				dataType: "json",
				data : {"act":"chkCode","id_code":value,"mobile":tel},
				success: function(data){
					if(data.flag == 0){
						$('#phoneArea').hide();code_s = true;switchTip('tbCode',1);
						var id = 'tbPhone';var value = $.trim($('#tbPhone').val());
						if(value=='请输入手机号码'){return false;}
						if(value){
							if(v.chkPhone(value)==false){
								$('#'+id+'_w').html('格式输入有误！');phone_s = false;switchTip(id,2);
							}else{
								phone_s = true;switchTip(id,1);
							}
						}else{
							phone_s = false;switchTip(id,0);
						}
					}else{
						var id = 'tbCode';$('#phoneArea').show();$('#'+id+'_w').html(data.msg);code_s = false;switchTip(id,2);
					}
				}
			});
		}
		limit  = true;
	
	
	
	
	
	
	
	
	
		
	
		var phone = $.trim($('#tbPhone').val());
		var code = $.trim($('#tbCode').val());
		
		if(phone_s && code_s){
			$.ajax({
				type: "POST",
				url: "{U('Member/Profile/binding')}",
				dataType: "json",
				data : {"act":"bind","mobile":phone,"id_code":code},
				success: function(data){
					if(data.flag == 1){
						popup.prompt(data.msg);
						location.href= '<?php echo $_GET['__URL__']?>';
						//juxiangyou.component.popup._reload = true;
						//juxiangyou.component.popup.prompt(data.msg,300);
					}else{
						juxiangyou.component.popup._reload = false;
						juxiangyou.component.popup.prompt(data.msg,300);
					}
				}
			});
		}else if(!phone_s){
			$('#tbPhone').val('请输入手机号码');
		}else if(!code_s){
			$('#tbCode').focus();
		}
	});

});
function getCode()
{
	if(!limit) return;
	var phone = $.trim($('#tbPhone').val());var phone_s = false;
	if(!phone){
		phone_s = false;
		$('#tbPhone').val('请输入手机号码');
		switchTip('tbPhone',0);return false;
	}else if(v.chkPhone(phone)==false){
		phone_s = false;switchTip('tbPhone',2);$('#tbPhone').val('请输入手机号码');return false;
	}else{
		phone_s = true;switchTip('tbPhone',1);
	}
	limit = false;
	$.ajax({
		type: "POST",
		url: "{U('Member/Profile/send_telcode')}",
		dataType: "json",
		data : {"act":"sendMsg","phone":phone},
		success: function(data){
			if(data.flag == 1){
				ShowSecond(parseInt(60)); 
			}else{
				$('#tbPhone_w').html(data.msg);switchTip('tbPhone',2);
			}
			limit = true;
		}
	});
}
function switchTip(id,sign)
{
	var iObject = $('#'+id+'_i');
	var wObject = $('#'+id+'_w');
	var sObject = $('#'+id+'_s');
	if(sign==1){iObject.hide();wObject.hide();sObject.show();}
	else if(sign==2){iObject.hide();wObject.show();sObject.hide();}
	else{iObject.show();wObject.hide();sObject.hide();}
}


function ShowSecond(cDate)
{
	if(cDate > 1){
		var _html = '<span id="lastTime"><span style="color:red">'+(--cDate)+'</span>秒后可重新发送</span>';
		$('#phoneArea').html(_html);
		setTimeout("ShowSecond("+cDate+")",1000);
	}
	else{
		var _html = '<a href="javascript:void(0);" onclick="getCode()" class="b40link">点击获取验证码</a>';
		$('#phoneArea').html(_html);
	} 

}
ShowSecond(parseInt("")); 

--></script>